String Commands & Variables


Basics
String variables have $ sign at the end:

mystring$

To assign a string to the variable we use:

mystring$ = 'This is a text'

Note: we use ' not " character

To put a ' character (Like in Oscar's) use \'

Example:
mystring$ = 'This is Oscar\'s project'

You can add backslash at the end of a string by using \\
path$ = 'c:\mydir\\'
will be displayed as c:\mydir\

Strings can use operator plus (as many as you want):
a$ = 'MMB '
mystring$ = a$ + 'is cool'

CHAR function
You cannot mix numerical and string variables.
To convert a numerical variable to string we use CHAR function
value = 2.45
mystring$ = CHAR(value)

VAL function
To convert a string variable to numerical variable we use VAL function
mystring$= '1.222'
value = VAL(mystring$)

String in IF-END command

We use similar syntax to numerical variables:

If (mystring$= 'yes')
....
End

or

If (mystring$<> 'yes')
...
End

Clipboard("SEND/GET","stringvariable$")

SEND or GET string variable to/from clipboard.

 

LoadText("TEXTOBJECT","VARIABLE")

Put the string into Text object (Text, Paragraph, Text Object...)